package edu.hawaii.halealohacli;

import org.junit.Test;
import org.wattdepot.client.WattDepotClient;

/**
 * Test class for bad user inputs to system.
 * 
 * @author John MacMillan
 * @author Mitchell Kupfer
 * @author Bryson Hori
 * 
 */
public class TestUserInputs {

  private String badCommand1;
  private String badCommand2;
  private String badCommand3;
  private String badCommand4;
  private String badCommand5;
  private String badCommand6;
  private String badCommand7;
  private String badCommand8;
  private String badCommand9;
  protected boolean test;

  private Processor processor;

  /**
   * Default constructor. Initializes bad user input for testing.
   */
  public TestUserInputs() {
    badCommand1 = " ";
    badCommand2 = "@#$%^";
    badCommand3 = "ranktowers";
    badCommand4 = "Qiut";
    badCommand5 = "";
    badCommand6 = "\n";
    badCommand7 = "daily-energy p q";
    badCommand8 = "rank-towers poo pee";
    badCommand9 = "current-power towerxyz";
    processor = new Processor();
  }

  /**
   * Tests the Processor classes ability to handle bad input and give the used feedback on why an
   * error has occurred.
   * 
   * @throws Exception if an error occurs.
   */
  @Test
  public void testCommands() throws Exception {
    String url = "http://server.wattdepot.org:8190/wattdepot/";

    // Create a WattDepotClient with URL
    WattDepotClient client = new WattDepotClient(url);

    processor.parseInput(badCommand1, client);
    processor.parseInput(badCommand2, client);
    processor.parseInput(badCommand3, client);
    processor.parseInput(badCommand4, client);
    processor.parseInput(badCommand5, client);
    processor.parseInput(badCommand6, client);
    processor.parseInput(badCommand7, client);
    processor.parseInput(badCommand8, client);
    processor.parseInput(badCommand9, client);

  }
}
